Skip to content

Make balance search use async - #6

Open
SachinMeier wants to merge 1 commit into
masterfrom
sachin--speed-up-balance-finding-using-async
Open

SachinMeier wants to merge 1 commit into
masterfrom
sachin--speed-up-balance-finding-using-async

Conversation

@SachinMeier

Copy link
Copy Markdown
Contributor

Refactors the logic for finding balances for accounts to be faster.

@SachinMeier
SachinMeier force-pushed the sachin--speed-up-balance-finding-using-async branch from 54590f2 to 51a0e87 Compare September 23, 2024 18:14
Comment thread lib/proof_of_reserves.ex
Comment on lines +148 to 154
left_task =
Task.async(fn -> do_find_balances_for_accounts(left_leaves, leaf_idx, account_balances) end)

right_task =
Task.async(fn ->
do_find_balances_for_accounts(right_leaves, leaf_idx + mid_idx, account_balances)
end)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic can easily run into the max number of beam processes. Does that make this not the right solution?

One option is an explicit conditional to use async or sequential searches depending on the number of leaves.

@Kushlord101

Copy link
Copy Markdown

``git clone https://github.com/RiverFinancial/proof-of-reserves.git cd proof-of-reserves ./scripts/setup.sh source "$HOME/.asdf/asdf.sh"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants